import sdljava.SDLException;
import sdljava.event.*;
import sdljava.video.SDLRect;


public class Earth extends Planet{

	public Earth(GameWindow gameWindow, String imageFile) throws SDLException {
		super(gameWindow, imageFile);
	}
	
	public void show() throws SDLException{
		locationImage.blitSurface(gameWindow.getGameSurface());
		showButtonSprites();
		if(chosenCharacter != null){
			chosenCharacter.getSpriteImageData().setZoom(0.1, 0.1);
			chosenCharacter.reZoom();
			chosenCharacter.show(chosenCharacter.getSpriteImage().get(0));
		}
		gameWindow.getGameSurface().flip();
	}
	
	public void showSpecific(SDLRect direction) throws SDLException{
		locationImage.blitSurface(gameWindow.getGameSurface());
		showButtonSprites();
		chosenCharacter.show(direction);
		gameWindow.getGameSurface().flip();
	}
	
	public void handleEvent(SDLEvent event) throws SDLException{
		if(event.getType() == SDLEvent.SDL_KEYDOWN){
			SDLRect charactermove = chosenCharacter.spriteHandle(event);
			if(charactermove != null){
				showSpecific(charactermove);
			}
			if(chosenCharacter.getPositionX() >= 1140 && chosenCharacter.getPositionX() <= 1193 && chosenCharacter.getPositionY() >= 50 && chosenCharacter.getPositionY() <= 150){
				changeLocation = 1;
			}
		}
		/*if(event.getType() == SDLEvent.SDL_MOUSEBUTTONDOWN){
			int currentX = ((SDLMouseButtonEvent)event).getX();
			int currentY = ((SDLMouseButtonEvent)event).getY();
			System.out.println(currentX);
			System.out.println(currentY);
		}*/
		
	}

}
